/*
 * Amazon Ads API - Sponsored Products
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](setting-up/account-setup) topic.<br/><br/> 
 *
 * The version of the OpenAPI document: 2.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.ProductAdExServingStatusDetails;
import org.openapitools.client.model.State;

/**
 * ProductAdEx
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-12T19:05:39.971406+08:00[Asia/Shanghai]")
public class ProductAdEx {
  public static final String SERIALIZED_NAME_AD_ID = "adId";
  @SerializedName(SERIALIZED_NAME_AD_ID)
  private BigDecimal adId;

  public static final String SERIALIZED_NAME_CAMPAIGN_ID = "campaignId";
  @SerializedName(SERIALIZED_NAME_CAMPAIGN_ID)
  private BigDecimal campaignId;

  public static final String SERIALIZED_NAME_AD_GROUP_ID = "adGroupId";
  @SerializedName(SERIALIZED_NAME_AD_GROUP_ID)
  private BigDecimal adGroupId;

  public static final String SERIALIZED_NAME_SKU = "sku";
  @SerializedName(SERIALIZED_NAME_SKU)
  private String sku;

  public static final String SERIALIZED_NAME_ASIN = "asin";
  @SerializedName(SERIALIZED_NAME_ASIN)
  private String asin;

  public static final String SERIALIZED_NAME_STATE = "state";
  @SerializedName(SERIALIZED_NAME_STATE)
  private State state;

  public static final String SERIALIZED_NAME_CREATION_DATE = "creationDate";
  @SerializedName(SERIALIZED_NAME_CREATION_DATE)
  private BigDecimal creationDate;

  public static final String SERIALIZED_NAME_LAST_UPDATED_DATE = "lastUpdatedDate";
  @SerializedName(SERIALIZED_NAME_LAST_UPDATED_DATE)
  private BigDecimal lastUpdatedDate;

  /**
   * The computed status of the product ad. See the [developer notes](https://advertising.amazon.com/API/docs/en-us/get-started/developer-notes) for more information.
   */
  @JsonAdapter(ServingStatusEnum.Adapter.class)
  public enum ServingStatusEnum {
    AD_ARCHIVED("AD_ARCHIVED"),
    
    AD_PAUSED("AD_PAUSED"),
    
    AD_STATUS_LIVE("AD_STATUS_LIVE"),
    
    AD_POLICING_SUSPENDED("AD_POLICING_SUSPENDED"),
    
    CAMPAIGN_OUT_OF_BUDGET("CAMPAIGN_OUT_OF_BUDGET"),
    
    AD_GROUP_PAUSED("AD_GROUP_PAUSED"),
    
    AD_GROUP_ARCHIVED("AD_GROUP_ARCHIVED"),
    
    CAMPAIGN_PAUSED("CAMPAIGN_PAUSED"),
    
    CAMPAIGN_ARCHIVED("CAMPAIGN_ARCHIVED"),
    
    ACCOUNT_OUT_OF_BUDGET("ACCOUNT_OUT_OF_BUDGET"),
    
    MISSING_DECORATION("MISSING_DECORATION"),
    
    PENDING_START_DATE("PENDING_START_DATE");

    private String value;

    ServingStatusEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static ServingStatusEnum fromValue(String value) {
      for (ServingStatusEnum b : ServingStatusEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<ServingStatusEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final ServingStatusEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public ServingStatusEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return ServingStatusEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_SERVING_STATUS = "servingStatus";
  @SerializedName(SERIALIZED_NAME_SERVING_STATUS)
  private ServingStatusEnum servingStatus;

  public static final String SERIALIZED_NAME_SERVING_STATUS_DETAILS = "servingStatusDetails";
  @SerializedName(SERIALIZED_NAME_SERVING_STATUS_DETAILS)
  private List<ProductAdExServingStatusDetails> servingStatusDetails = null;


  public ProductAdEx adId(BigDecimal adId) {
    
    this.adId = adId;
    return this;
  }

   /**
   * The product ad identifier.
   * @return adId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The product ad identifier.")

  public BigDecimal getAdId() {
    return adId;
  }


  public void setAdId(BigDecimal adId) {
    this.adId = adId;
  }


  public ProductAdEx campaignId(BigDecimal campaignId) {
    
    this.campaignId = campaignId;
    return this;
  }

   /**
   * The campaign identifier.
   * @return campaignId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The campaign identifier.")

  public BigDecimal getCampaignId() {
    return campaignId;
  }


  public void setCampaignId(BigDecimal campaignId) {
    this.campaignId = campaignId;
  }


  public ProductAdEx adGroupId(BigDecimal adGroupId) {
    
    this.adGroupId = adGroupId;
    return this;
  }

   /**
   * The ad group identifier.
   * @return adGroupId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The ad group identifier.")

  public BigDecimal getAdGroupId() {
    return adGroupId;
  }


  public void setAdGroupId(BigDecimal adGroupId) {
    this.adGroupId = adGroupId;
  }


  public ProductAdEx sku(String sku) {
    
    this.sku = sku;
    return this;
  }

   /**
   * The SKU associated with the product. Defined for seller accounts only.
   * @return sku
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The SKU associated with the product. Defined for seller accounts only.")

  public String getSku() {
    return sku;
  }


  public void setSku(String sku) {
    this.sku = sku;
  }


  public ProductAdEx asin(String asin) {
    
    this.asin = asin;
    return this;
  }

   /**
   * The ASIN associated with the product. Defined for vendors only.
   * @return asin
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The ASIN associated with the product. Defined for vendors only.")

  public String getAsin() {
    return asin;
  }


  public void setAsin(String asin) {
    this.asin = asin;
  }


  public ProductAdEx state(State state) {
    
    this.state = state;
    return this;
  }

   /**
   * Get state
   * @return state
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public State getState() {
    return state;
  }


  public void setState(State state) {
    this.state = state;
  }


  public ProductAdEx creationDate(BigDecimal creationDate) {
    
    this.creationDate = creationDate;
    return this;
  }

   /**
   * The epoch date the product ad was created.
   * @return creationDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The epoch date the product ad was created.")

  public BigDecimal getCreationDate() {
    return creationDate;
  }


  public void setCreationDate(BigDecimal creationDate) {
    this.creationDate = creationDate;
  }


  public ProductAdEx lastUpdatedDate(BigDecimal lastUpdatedDate) {
    
    this.lastUpdatedDate = lastUpdatedDate;
    return this;
  }

   /**
   * The epoch date the product ad was last updated.
   * @return lastUpdatedDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The epoch date the product ad was last updated.")

  public BigDecimal getLastUpdatedDate() {
    return lastUpdatedDate;
  }


  public void setLastUpdatedDate(BigDecimal lastUpdatedDate) {
    this.lastUpdatedDate = lastUpdatedDate;
  }


  public ProductAdEx servingStatus(ServingStatusEnum servingStatus) {
    
    this.servingStatus = servingStatus;
    return this;
  }

   /**
   * The computed status of the product ad. See the [developer notes](https://advertising.amazon.com/API/docs/en-us/get-started/developer-notes) for more information.
   * @return servingStatus
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The computed status of the product ad. See the [developer notes](https://advertising.amazon.com/API/docs/en-us/get-started/developer-notes) for more information.")

  public ServingStatusEnum getServingStatus() {
    return servingStatus;
  }


  public void setServingStatus(ServingStatusEnum servingStatus) {
    this.servingStatus = servingStatus;
  }


  public ProductAdEx servingStatusDetails(List<ProductAdExServingStatusDetails> servingStatusDetails) {
    
    this.servingStatusDetails = servingStatusDetails;
    return this;
  }

  public ProductAdEx addServingStatusDetailsItem(ProductAdExServingStatusDetails servingStatusDetailsItem) {
    if (this.servingStatusDetails == null) {
      this.servingStatusDetails = new ArrayList<ProductAdExServingStatusDetails>();
    }
    this.servingStatusDetails.add(servingStatusDetailsItem);
    return this;
  }

   /**
   * Details of serving status. Only statuses related to moderation according to the ad policy are currently included.
   * @return servingStatusDetails
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Details of serving status. Only statuses related to moderation according to the ad policy are currently included.")

  public List<ProductAdExServingStatusDetails> getServingStatusDetails() {
    return servingStatusDetails;
  }


  public void setServingStatusDetails(List<ProductAdExServingStatusDetails> servingStatusDetails) {
    this.servingStatusDetails = servingStatusDetails;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ProductAdEx productAdEx = (ProductAdEx) o;
    return Objects.equals(this.adId, productAdEx.adId) &&
        Objects.equals(this.campaignId, productAdEx.campaignId) &&
        Objects.equals(this.adGroupId, productAdEx.adGroupId) &&
        Objects.equals(this.sku, productAdEx.sku) &&
        Objects.equals(this.asin, productAdEx.asin) &&
        Objects.equals(this.state, productAdEx.state) &&
        Objects.equals(this.creationDate, productAdEx.creationDate) &&
        Objects.equals(this.lastUpdatedDate, productAdEx.lastUpdatedDate) &&
        Objects.equals(this.servingStatus, productAdEx.servingStatus) &&
        Objects.equals(this.servingStatusDetails, productAdEx.servingStatusDetails);
  }

  @Override
  public int hashCode() {
    return Objects.hash(adId, campaignId, adGroupId, sku, asin, state, creationDate, lastUpdatedDate, servingStatus, servingStatusDetails);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ProductAdEx {\n");
    sb.append("    adId: ").append(toIndentedString(adId)).append("\n");
    sb.append("    campaignId: ").append(toIndentedString(campaignId)).append("\n");
    sb.append("    adGroupId: ").append(toIndentedString(adGroupId)).append("\n");
    sb.append("    sku: ").append(toIndentedString(sku)).append("\n");
    sb.append("    asin: ").append(toIndentedString(asin)).append("\n");
    sb.append("    state: ").append(toIndentedString(state)).append("\n");
    sb.append("    creationDate: ").append(toIndentedString(creationDate)).append("\n");
    sb.append("    lastUpdatedDate: ").append(toIndentedString(lastUpdatedDate)).append("\n");
    sb.append("    servingStatus: ").append(toIndentedString(servingStatus)).append("\n");
    sb.append("    servingStatusDetails: ").append(toIndentedString(servingStatusDetails)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

